@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap");

:root {
  --primary-color: #8e44ad;
  --background-color: #b8c6db;
  --secondary-background-color: #f5f7fa;
  --light-color: #fff;
  --border-color: #aaa;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--background-color);
  background-image: linear-gradient(315deg, var(--background-color) 0%, var(--secondary-background-color) 100%);
  font-family: "Poppins", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

h1 button {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 2;
}

.btn {
  cursor: pointer;
  background-color: var(--background-color);
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.btn-small {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.btn-ghost {
  border: 0;
  background-color: transparent;
}

.btn-margin {
  margin-top: 1.25rem;
  width: 28.125rem;
  max-width: 90%;
}

.btn:hover {
  background-color: var(--primary-color);
  color: var(--light-color);
}

.btn:focus, .navigation .nav-button:focus {
  outline: none;
}

.clear {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
}

.cards {
  perspective: 1000px;
  position: relative;
  width: 31.25rem;
  max-width: 90%;
  height: 18.75rem;
}

.card {
  background-color: var(--light-color);
  border-radius: 0.625rem;
  position: absolute;
  font-size: 1.5rem;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(50%) rotateY(-10deg);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.card.active {
  cursor: pointer;
  opacity: 1;
  z-index: 10;
  transform: translateX(0) rotateY(0deg);
}

.card.left {
  transform: translateX(-50%) rotateY(10deg);
}

.inner-card {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
  border-radius: 0.625rem;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.card.show-answer .inner-card {
  transform: rotateX(180deg);
}

.inner-card-front, .inner-card-back {
  backface-visibility: hidden;
  background-color: var(--light-color);
  border-radius: 0.625rem;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.inner-card-front {
  transform: rotateX(0deg);
  z-index: 2;
}

.inner-card-back {
  transform: rotateX(180deg);
}

.inner-card-front::after, .inner-card-back::after {
  content: '\f021  Flip';
  font-family: 'Font Awesome 5 Free', 'Poppins', sans-serif;
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  font-weight: bold;
  font-size: 1rem;
  color: var(--background-color);
}

.navigation {
  display: flex;
  margin: 1.25rem 0;
}

.navigation .nav-button {
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 1rem;
}

.navigation .nav-button:hover {
  transform: scale(1.2)
}

.navigation p {
  margin: 0 1.5rem;
}

.add-container {
  background-color: var(--secondary-background-color);
  border-top: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 0;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  z-index: -1;
  transition: all 0.3s ease;
}

.add-container.show {
  opacity: 1;
  z-index: 2;
}

.add-container h3 {
  margin: 0.625rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.form-group label {
  display: block;
  margin: 1.25rem 0 0.625rem;
}

.form-group textarea {
  border: 1px solid var(--border-color);
  border-radius: 0.625rem;
  font-size: 1rem;
  padding: 0.75rem;
  width: 31.25rem;
  max-width: 90%;
}
